include:
  - openstack.queen.glance.install

glance-image-cirros:
  file.managed:
    - name: /usr/local/src/cirros-0.3.5-x86_64-disk.img
    - source: salt://openstack/queen/glance/files/cirros-0.3.5-x86_64-disk.img
    - user: root
    - group: root
    - mode: 644

glance-image-import:
  file.managed:
    - name: /etc/script/glance-image-import.sh
    - source: salt://openstack/queen/glance/files/glance-image-import.sh
    - user: root
    - group: root
    - mode: 700
  cmd.run:
    - name: bash /etc/script/glance-image-import.sh && touch /etc/lock/glance-image-import.lock
    - require:
      - cmd: glance-service-endpoint
      - file: glance-image-cirros
    - unless : test -f /etc/lock/glance-image-import.lock
